package com.guoyh.bilbase.ext

import androidx.fragment.app.Fragment

/**
 * @CreateDate: 7/20/21 3:29 PM
 * @Author: guoyh
 * @Description: java类作用描述
 */

fun Fragment.getIntentStr(key: String, default: String = "") = run {
    val str = arguments?.getString(key, default)
    if (str.isNullOrEmpty()) {
        default
    } else {
        str
    }
}

fun Fragment.getIntentBoolen(key: String, default: Boolean = false) = run {
    try {
        val bool = arguments!!.getBoolean(key, default)
        bool
    } catch (e: Exception) {
        default
    }
}
